using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ShipExplorerItem : MonoBehaviour
{
    public Image m_Preview;
    public Text m_NameL;
    public Text m_TypeIDL;
    public Ship m_Ship;
    public ShipExplorerList m_ExplorerList;
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    public void Init(Ship ship)
    {
        m_Ship = ship;
        m_TypeIDL.gameObject.SetActive(Main.m_GM.m_DevelopmentMode);
        m_NameL.text = m_Ship.m_TypeName;
        m_TypeIDL.text = ship.m_ShipTypeID.ToString();
        m_Preview.sprite = m_Ship.GetComponent<SpriteRenderer>().sprite;

    }
    public void OnOpenToBlueprint()
    {
        m_ExplorerList.OnShipItemOpenByBlueprintClicked(m_Ship);
    }
    public void OnDeleteClicked()
    {
        m_ExplorerList.OnShipItemDeleteClicked(m_Ship);
    }
}
